#include<bits/stdc++.h>
using namespace std;
const int N=100010;
int n;
int p[N];
int a[N];
int ans;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++) cin>>p[i];
    sort(p+1,p+n+1);
    a[1]=0;
    int t=1;
    long long sum=0;
    ans=n;
    for(int i=2;i<=n;i++){
        if(p[i-1]==p[i]) a[i]+=0,t++;
        else a[i]+=t,t=1;
        sum+=a[i];
        if(sum) ans--,a[i+1]--;
    }//differ
    cout<<ans;
    return 0;
}
